home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr52
/
mktouch.zip
/
MKTOUCH.PRG
< prev
Wrap
Text File
|
1993-04-26
|
6KB
|
232 lines
#pragma W_MAC_REDEF-
#pragma W_FUNC_PROC-
#define GERMANS && Comment it, if you want an
&& english version ...
#include MKSYSTEM.HDR
#include MKSTATUS.HDR
#include MKSTRING.HDR
#include MKSCREEN.HDR
#include SYSTEM.HDR
#include STRING.HDR
#include MKFILE.HDR
#include MKMISC.HDR
#include MKTIME.HDR
#include MKBIT.HDR
#include DATE.HDR
#include IO.HDR
VARDEF EXTERN
BYTE __color_std
ENDDEF
********************************************************************************
PROCEDURE Help
CLEAR
@ 01, 01 TO MaxRow() - 1, MaxCol() - 1 DOUBLE
Bright()
@ 03, 30 ?? "MK Touch Version 1.0"
@ 04, 19 ?? "(C) 1992 by Unternehmensberatung Kalkhoff"
@ 05, 24 ?? "The FCO/Force File Touch Utility"
NoBright()
#ifdef GERMANS
@ 06, 09 ?? "Entwicklungssystem : FCO Version 2.4 / MK Advanced Version 2.4"
@ 08, 04 ?? "Mittels dieses Utilities sind Sie in der Lage, das Datum und die Zeit von"
@ 09, 04 ?? "einzelnen Dateien oder Dateigruppen zu modifizieren. Im Gegensatz zu an-"
@ 10, 04 ?? "deren Tools kann hierbei das Datum und die Zeit frei bestimmt werden !!!"
Bright()
@ 12, 04 ?? "Anwendung : "
NoBright()
?? "MKTouch <Dateiname> [/H] [/D<Datum>] [/T[Zeit>]"
@ 14, 04 ?? "Alle Parameter außer dem Dateiname bzw. -maske sind optional. Standard-"
@ 15, 04 ?? "mäßig wird das Systemdatum und die Systemzeit benutzt. Wildcards inner-"
@ 16, 04 ?? "halb des Dateinamens werden voll unterstützt ..."
Bright()
@ 18, 04 ?? "Beispiele : "
NoBright()
?? "MKTouch *.* benutze Systemdatum und -zeit"
@ 19, 16 ?? "MKTouch \*.* /T12 setze Zeit auf 12:00:00 Uhr"
@ 20, 16 ?? "MKTouch *.* /T12 /D24.07.92 benutze definierte Werte"
Bright()
@ 22, 25 ?? "Bitte beliebige Taste drücken ..."
#else
@ 06, 09 ?? "Development System : FCO Version 2.4 / MK Advanced Version 2.4"
@ 08, 04 ?? "This utility allow you to touch the date and time of one or more files."
@ 09, 04 ?? "The difference to other tools is, that you can define the date and the"
@ 10, 04 ?? "time for the touch operation !!! Funny, eeeh ???"
Bright()
@ 12, 04 ?? "Usage : "
NoBright()
?? "MKTouch <filename> [/H] [/D<date>] [/T[time>]"
@ 14, 04 ?? "All parameters without the filename are optional. The default of time"
@ 15, 04 ?? "and date are the values from the System. Wildcards within the filename"
@ 16, 04 ?? "are allowed ..."
Bright()
@ 18, 04 ?? "Examples : "
NoBright()
?? "MKTouch *.* use system's date and time"
@ 19, 15 ?? "MKTouch \*.* /T12 set time to 12:00:00"
@ 20, 15 ?? "MKTouch *.* /T12 /D24.07.92 use defined values"
Bright()
@ 22, 25 ?? "press any key to continue ..."
#endif
Get_Key()
CLEAR
QUIT
ENDPRO
********************************************************************************
PROCEDURE Usage
#ifdef GERMANS
? "Aufruf ist : MKTOUCH <Dateimaske> [/D<Datumsangabe>] [/T<Zeitangabe>]"
? " MKTOUCH /H für mehr Hilfe ..."
#else
? "Usage is : MKTOUCH <file_mask> [</D<date_value>] [/T<time_value>]"
? " MKTOUCH /H for more help ..."
#endif
?
QUIT
ENDPRO
********************************************************************************
PROCEDURE Fco_Main
VARDEF
DATE touch_date
CHAR( 08 ) touch_time
CHAR( 128 ) touch_path
INT touch_file
INT i, params
ENDDEF
#ifdef GERMANS && set date format in
SetDate( &DATE_GERMAN ) && dependence of the language
#else
SetDate( &DATE_AMERICAN )
#endif
__color_std = GetDosColor() && initialize the variables
touch_date = Today() && with default values
touch_time = Time()
params = ParamCount()
SetParamFormat( &PARAM_2UPPER ) && the function PARAMSTR
&& returns now uppercase letters
Scrn_Bios()
Key_Dos()
Bright() && display copyright ...
? "MK Touch Version 1.0"
NoBright()
? "(C) 1992 by Unternehmensberatung Kalkhoff"
?
IF params = 0 && are there parameters ???
&& no, what for a shit ...
Usage()
ELSE
FOR i = 1 TO params && process all parameters
touch_path = ParamStr( i )
DO CASE
CASE Left( touch_path, 1 ) = "D"
touch_date = Ctod( Right( touch_path, Len( touch_path ) - 1 ) )
CASE Left( touch_path, 1 ) = "T"
touch_time = Right( touch_path, Len( touch_path ) - 1 )
IF .NOT. ValidTime( touch_time )
#ifdef GERMANS
? "ungültige Zeitangabe !!!"
#else
? "invalid time !!!"
#endif
Sound( 150, 2 )
QUIT
ENDIF
CASE Left( touch_path, 1 ) $ "H?"
Help()
OTHERWISE && suppose that this is the
touch_file = i && filename
ENDCASE
NEXT
ENDIF
touch_path = ""
i = Rat( "\", ParamStr( touch_file ) )
IF i > 0
touch_path = LEFT( ParamStr( touch_file ), i )
ELSE
i = AT( ":", ParamStr( touch_file ) )
IF i > 0
touch_path = Left( ParamStr( touch_file ), i )
ENDIF
ENDIF
i = 0
&& process all files ...
IF Find_First( ParamStr( touch_file ), &FIND_ANYFILE )
REPEAT
IF FTouch( touch_path + Find_FStr(), touch_date, touch_time )
i = i + 1
ENDIF
UNTIL .NOT. Find_Next()
ENDIF
Bright()
#ifdef GERMANS
? i : 4, "Dateien bearbeitet ..."
#else
? i : 4, "Files stamped ..."
#endif
NoBright()
#ifdef GERMANS
? "Neue Erstellungszeit ist :", touch_time
? "Neues Erstellungsdatum ist :", touch_date
#else
? "Touch time was :", touch_time
? "Touch date was :", touch_date
#endif
?
ENDPRO